//
//  YSCategoryItemCell.m
//  Yueshi
//
//  Created by Northwan on 15/7/21.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSCategoryItemCell.h"
@interface YSCategoryItemCell()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;


@end

@implementation YSCategoryItemCell


+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath{
    
    UINib *nib = [UINib nibWithNibName:@"YSCategoryItemCell" bundle: [NSBundle mainBundle]];
    [collectionView registerNib:nib forCellWithReuseIdentifier:@"YSCategoryItemCell"];
    YSCategoryItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier: @"YSCategoryItemCell" forIndexPath:indexPath];
    [cell setBackgroundColor:PUBLIC_CARD_BG];
    return cell;
}

-(void)setCategory:(YSProductCategory *)category{
    [self.iconView setImageURLStr:category.categoryIcon];
    [self.nameLabel setText:category.categoryName];
    [self.descLabel setText:category.categoryDesc];
}

@end
